package com.candy.candymessage.business.service.impl;

import com.candy.candycommon.utils.HttpPostUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author suYanLong
 * @date 2023年01月31日 16:27
 */
@Slf4j
@Component("ding")
public class MsgSendDingServiceImpl extends MsgSendServiceImpl {

    @Override
    public boolean sendMsg(String message) {
        String dingUrl = "https://oapi.dingtalk.com/robot/send?access_token=a49dc118602c112b6e532d061e7f53434fff7193fd34b503e13bf3e4e2c01840";
        String msg = "{\"msgtype\": \"text\",\"text\": {\"content\":\"" + message + "\"},\n" +
                " \"at\": {\n" +
                "        \"atMobiles\": [\"15930154459\"]\n" +
                "    }}";
        log.info(msg);
        String s = HttpPostUtil.doPost(dingUrl, msg);
        System.out.println(s);
        return true;
    }

//    @Override
//    public boolean sendMsgNotice(String msg) {
//        return super.sendMsgNotice(msg);
//    }

}
